Update Method (AddressEntry Object)
The Update
method saves AddressEntry object changes in the MAPI system.
Syntax
objAddressEntry.Update( [makePermanent, refreshObject]
)
Parameters
objAddressEntry
Required. The
AddressEntry object.
makePermanent
Optional.
Boolean. TRUE indicates that the property cache is flushed and all changes are
committed in the underlying message store. FALSE indicates that the property
cache is flushed and not committed to the message store. The default value is
TRUE.
refreshObject
Optional.
Boolean. TRUE indicates that the property cache is reloaded from the values in
the underlying message store. FALSE indicates that the property cache is not
reloaded. The default value is FALSE.
Remarks
Changes to
objects are not permanently saved in the MAPI system until you call the Update
method with the makePermanent parameter set to TRUE.
For improved
performance, the OLE Messaging Library caches property changes in private
storage and updates either the object or the underlying message store only when
you explicitly request such an update. For efficiency, you should make only one
call to Update with its makePermanent parameter set to TRUE.
The makePermanent
and refreshObject parameters combine to cause the following changes:
|
refreshObject
= TRUE |
refreshObject
= FALSE |
makePermanent
= TRUE |
Commit all
changes, flush the cache, and reload the cache from the message store. |
Commit all
changes and flush the cache. |
makePermanent
= FALSE |
Flush the
cache and reload the cache from the message store. |
Flush the
cache. |
Call Update(FALSE,
TRUE) to flush the cache and then reload the values from the message store.
Example
The following
example changes the display name for the valid AddressEntry address:
' Function: AddressEntry_Update
' Purpose: Demonstrate the Update method
' (Note:
OLE Messaging Library only affects the PAB)
Function AddressEntry_Update()
Dim objRecipColl As Object ' Recipients collection
Dim objNewRecip As Object ' New recipient
' error
handling omitted...
Set
objRecipColl = objSession.AddressBook
If objRecipColl
Is Nothing Then
MsgBox
"must select someone from the address book"
Exit
Function
End If
Set
objNewRecip = objRecipColl.Item(1)
With objNewRecip.AddressEntry
.Name
= .Name & " the Magnificent"
.Type
= "X.500" ' you can also
change the Type
.Update
End With
MsgBox
"Updated an address entry name: " & _
objNewRecip.AddressEntry.Name
Exit
Function
' error
handling omitted
End Function
See Also
Recipient
Object